#!/bin/bash
mkdir cache
rm -rf cache/*
curDir=$(pwd)
for(( i=0; i<20; i++))
do
	ffmpeg -i $1 -vcodec copy -acodec copy -vbsf h264_mp4toannexb cache/video_${i}.ts
	echo "file '${curDir}/cache/video_${i}.ts'" >> cache/filelist.txt
done
ffmpeg -f concat -safe 0 -i cache/filelist.txt -c copy output.mp4
